package com.git.controller;

import com.git.bean.House;
import com.git.bean.Street;
import com.git.service.HouseService;
import com.git.service.StreetService;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 金振宇
 * @describe
 */
@Controller
@RequestMapping("street")
public class StreetController {

    private Logger logger = LoggerFactory.getLogger(UserController.class);

    @Reference(url = "dubbo://localhost:20880")
    private StreetService streetService;

    @RequestMapping("findStreet")
    @ResponseBody
    public List<Street> findStreet(Integer districtId){
        logger.info("查询街道信息",districtId);
        try {
            return streetService.selectStreetById(districtId);
        }catch (Exception e){
            logger.error("查询街道信息失败",e);
        }
        return null;
    }
}
